home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / complib / sgels.z / sgels
Text File  |  1998-10-30  |  5KB  |  133 lines

  1.  
  2.  
  3.  
  4. SSSSGGGGEEEELLLLSSSS((((3333FFFF))))                                                            SSSSGGGGEEEELLLLSSSS((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      SGELS - solve overdetermined or underdetermined real linear systems
  10.      involving an M-by-N matrix A, or its transpose, using a QR or LQ
  11.      factorization of A
  12.  
  13. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.      SUBROUTINE SGELS( TRANS, M, N, NRHS, A, LDA, B, LDB, WORK, LWORK, INFO )
  15.  
  16.          CHARACTER     TRANS
  17.  
  18.          INTEGER       INFO, LDA, LDB, LWORK, M, N, NRHS
  19.  
  20.          REAL          A( LDA, * ), B( LDB, * ), WORK( LWORK )
  21.  
  22. PPPPUUUURRRRPPPPOOOOSSSSEEEE
  23.      SGELS solves overdetermined or underdetermined real linear systems
  24.      involving an M-by-N matrix A, or its transpose, using a QR or LQ
  25.      factorization of A.  It is assumed that A has full rank.
  26.  
  27.      The following options are provided:
  28.  
  29.      1. If TRANS = 'N' and m >= n:  find the least squares solution of
  30.         an overdetermined system, i.e., solve the least squares problem
  31.                      minimize || B - A*X ||.
  32.  
  33.      2. If TRANS = 'N' and m < n:  find the minimum norm solution of
  34.         an underdetermined system A * X = B.
  35.  
  36.      3. If TRANS = 'T' and m >= n:  find the minimum norm solution of
  37.         an undetermined system A**T * X = B.
  38.  
  39.      4. If TRANS = 'T' and m < n:  find the least squares solution of
  40.         an overdetermined system, i.e., solve the least squares problem
  41.                      minimize || B - A**T * X ||.
  42.  
  43.      Several right hand side vectors b and solution vectors x can be handled
  44.      in a single call; they are stored as the columns of the M-by-NRHS right
  45.      hand side matrix B and the N-by-NRHS solution matrix X.
  46.  
  47.  
  48. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  49.      TRANS   (input) CHARACTER
  50.              = 'N': the linear system involves A;
  51.              = 'T': the linear system involves A**T.
  52.  
  53.      M       (input) INTEGER
  54.              The number of rows of the matrix A.  M >= 0.
  55.  
  56.      N       (input) INTEGER
  57.              The number of columns of the matrix A.  N >= 0.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SSSSGGGGEEEELLLLSSSS((((3333FFFF))))                                                            SSSSGGGGEEEELLLLSSSS((((3333FFFF))))
  71.  
  72.  
  73.  
  74.      NRHS    (input) INTEGER
  75.              The number of right hand sides, i.e., the number of columns of
  76.              the matrices B and X. NRHS >=0.
  77.  
  78.      A       (input/output) REAL array, dimension (LDA,N)
  79.              On entry, the M-by-N matrix A.  On exit, if M >= N, A is
  80.              overwritten by details of its QR factorization as returned by
  81.              SGEQRF; if M <  N, A is overwritten by details of its LQ
  82.              factorization as returned by SGELQF.
  83.  
  84.      LDA     (input) INTEGER
  85.              The leading dimension of the array A.  LDA >= max(1,M).
  86.  
  87.      B       (input/output) REAL array, dimension (LDB,NRHS)
  88.              On entry, the matrix B of right hand side vectors, stored
  89.              columnwise; B is M-by-NRHS if TRANS = 'N', or N-by-NRHS if TRANS
  90.              = 'T'. On exit, B is overwritten by the solution vectors, stored
  91.              columnwise:  if TRANS = 'N' and m >= n, rows 1 to n of B contain
  92.              the least squares solution vectors; the residual sum of squares
  93.              for the solution in each column is given by the sum of squares of
  94.              elements N+1 to M in that column; if TRANS = 'N' and m < n, rows
  95.              1 to N of B contain the minimum norm solution vectors; if TRANS =
  96.              'T' and m >= n, rows 1 to M of B contain the minimum norm
  97.              solution vectors; if TRANS = 'T' and m < n, rows 1 to M of B
  98.              contain the least squares solution vectors; the residual sum of
  99.              squares for the solution in each column is given by the sum of
  100.              squares of elements M+1 to N in that column.
  101.  
  102.      LDB     (input) INTEGER
  103.              The leading dimension of the array B. LDB >= MAX(1,M,N).
  104.  
  105.      WORK    (workspace/output) REAL array, dimension (LWORK)
  106.              On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  107.  
  108.      LWORK   (input) INTEGER
  109.              The dimension of the array WORK.  LWORK >= min(M,N) +
  110.              MAX(1,M,N,NRHS).  For optimal performance, LWORK >= min(M,N) +
  111.              MAX(1,M,N,NRHS) * NB where NB is the optimum block size.
  112.  
  113.      INFO    (output) INTEGER
  114.              = 0:  successful exit
  115.              < 0:  if INFO = -i, the i-th argument had an illegal value
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.